/* Sentinel - IRC Statistical and Operator Services
** operlist.c - Functions to maintain a linked list of opers
**
** Copyright W. Campbell and others.  See README for more details
** Some code Copyright: Jonathan George, Kai Seidler, ircd-hybrid Team,
**                      IRCnet IRCD developers.
**
** $Id: operlist.c 7 2010-02-01 19:17:42Z dubkat $
*/

#include "stats.h"
#include "struct.h"
#include "proto.h"
#include <assert.h>
#include "slog.h"

void AddOperToList(dlink_list *operlist, struct User *u)
{
  dlink_node *dl = dlink_create();

  assert(u != NULL);
  assert(u->server != NULL);

  dlink_add(u, dl, operlist);
}

void DelOperFromList(dlink_list *operlist, struct User *u)
{
  dlink_node *dl = dlink_find_delete(u, operlist);

  if (dl != NULL)
  {
    dlink_free(dl);
    return ;
  }
  slog(DEFAULT_LOG, L_WARNING, "DelOperFromList:  user %s not in list", u->nick);
}

